﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Flattiverse;

namespace flattiverse
{
    static class Authentification
    {
       static private Connector connector;

        static public Connector _connector
        {
            set
            {
                connector = value;
            }
            get
            {
                return connector;
            }
        }
        
       
        //++++++++Nicht mehr verwendbar+++++++
        //public void register(string UserName, string Password)
        //{
        //    connenctor.CreateAccount(UserName, Password);
        //}
       public static string login(string UserName, string Password)
        {
            try
            {
                connector.Login(UserName, Password);
                return "Erfolgreich eingeloggt, " + connector.Account.Name;
            }
            catch
            {
                return "Einloggen fehlgeschlagen";
            }
        }
       public static string disconnect()
       {
           connector.Disconnect();
           return "Erfolgreich ausgeloggt";
       }
    }
}
